import service from '@/utils/request'

export const useUserApi = (id: number) => {
	return service.get('/kyy/user/' + id)
}

export const useUserSubmitApi = (dataForm: any) => {
	if (dataForm.id) {
		return service.put('/kyy/user', dataForm)
	} else {
		return service.post('/kyy/user', dataForm)
	}
}

// 更新用户状态
export const useUpdateUserStatusApi = (userId: number) => {
	return service.get('/kyy/user/update/status?userId=' + userId)
}

// 修改论坛状态
export const useUpdateUserForumStatusApi = (userId: number) => {
	return service.get('/kyy/user/update/forum/status?userId=' + userId)
}

// 修改评论状态
export const useUpdateUserCommentStatusApi = (userId: number) => {
	return service.get('/kyy/user/update/comment/status?userId=' + userId)
}

//封禁发言特定的时间
export const useUpdateCommentStatusTime = (dataForm: any) => {
	return service.post('/kyy/user/update/comment/status/time', dataForm)
}

//获取禁用所剩时间
export const useGetSilenceRemainingTime = (id: number) => {
	return service.get('/kyy/user/get/silence/remaining/time?userId=' + id)
}
